package com.realbrand.net.realbrandpay.ui.activity.mall;

import com.realbrand.net.realbrandpay.base.BasePersenter;
import com.realbrand.net.realbrandpay.bean.AdressBean;
import com.realbrand.net.realbrandpay.bean.MollCarBean;
import com.realbrand.net.realbrandpay.ui.activity.wallet.personer.adress.IModelManagerAdress;
import com.realbrand.net.realbrandpay.ui.activity.wallet.personer.adress.IViewManagerAdress;
import com.realbrand.net.realbrandpay.ui.activity.wallet.personer.adress.ModelManagerAdress;

import java.util.List;

/**
 * Created by Administrator on 2018/5/14.
 */

public class PersenterMollCarGetData extends BasePersenter<IViewMallCar> {
    /**
     * 获取所有线上商城的数据
     *
     * @param pramas
     */
    public void getData(String pramas) {
        if (!isViewAttched()) {
            return;
        }
        getView().showLoading();
        ModelMollCar.getMollCarData(pramas, new IModelManagerAdress<List<MollCarBean>>() {
            @Override
            public void onSuccess(List<MollCarBean> data) {
                if (isViewAttched()) {
                    getView().showData(data);
                }
            }

            @Override
            public void onFail(String msg) {
                if (isViewAttched()) {
                    getView().showFailMsg(msg);
                }
            }

            @Override
            public void onErrorr() {
                if (isViewAttched()) {
                    getView().showError();
                }
            }

            @Override
            public void onComplete() {
                if (isViewAttched()) {
                    getView().hideLoading();
                }
            }
        });
    }



}
